<!-- Web Upload (Data Upload) HTML File -->
<!-- Reveions History ...
	Rev 1.00 at 2015/02/23 by Max Yin:
		1. First time create
	Rev 1.01 at 2015/07/08 by Max Yin:
		1. 由標楷體, 改成新細明體
		2. 各栏位增加栏位框, 并置中显示排版
		3. Upload 的 WSID 增加重复多站选择
		4. 增加 Discrption 搜寻
-->
<html>
	<body background="pic/background_06.gif">
	<head>
		<font face="新細明體,time new roman,Arial">
		<meta charset="UTF-8">
		<!-- <script language="javascript"> -->
		<script type="text/javascript">
			function AddStr() { 
				// 从document对象中，获取select标签
				var SelectValue = document.getElementById("webul_select_wsid").value;
				var InputValue  = document.getElementById("input_wsid").value;
				var into_show   = 1;
				switch (SelectValue) {
					case "F/T":
					case "F/T-B":
					case "B/I":
					case "H/P":
					case "DL":
					case "ICT":
					case "SCT":
					case "ICT_SOP":
					case "SCT_SOP":
						// For F/T can be entry after F/T-B,F/T-B-C1,F/T-B1,F/T-B2 string ...
						var SplitStr = InputValue.split(","); //把字符串变为一个数组！
						SplitStr.forEach(
							function(ArryValue) {
								if ( ArryValue == SelectValue ) {
									into_show = 0;
									return;
								}
							}
						)
						break;
					default:
						if ( InputValue.indexOf(SelectValue) > -1 ) {
							into_show = 0;
						}
						break;
				}
				
				if ( into_show == 1 ) {
					if ( document.getElementById("input_wsid").value == '' ) {
						// To show wsid string to input area ...
						document.getElementById("input_wsid").value = SelectValue;
					} else {
						document.getElementById("input_wsid").value += ","+SelectValue;
					}
				}
			}
			
			function show_root() { 
				var root = document.getElementById("upload_file").value; 
				myform.root.value = root; 
			} 
			
			function ClearStr() { 
				document.getElementById("input_wsid").value = "";
			}
		</script>
	</head>
	<body>
		<center>
			<font size="5" color="#0000FF"><b>--- 请输入,程式/文件的查询资料 ---</b></font><br>
			<hr>
			<form name="form1" method="POST" action="webul_search_result.php"><br>
				<table border="2" width="75%">
					<tr bgcolor="#FF66CC"><th width="25%">Item(項目)</th><th width="45%">Input(输入)</th><th width="30%">Note(备注)</th></tr>
					<tr><th>Part Number(产品料号)</th><th><input type="text" name="webul_pn" maxlength="1024" size="45"></th><th><font size='2' color='#FF0000'><b>P/T站及之后站别的 PN, 在使用N阶或C阶, 须与流程卡(新)一致。若多组P/N上传相同档案，请用逗号','区分Ex:CRL615766000A,CRL615766007A,...。ROUTER(捞版),WS-PROFILE,ESD,DOC(文件)此处填'N/A'</b></font></th></tr>
					<tr><th>WSID(站別)</th>
						<th><select id='webul_select_wsid' size="1">
							<?php 
									require_once('class_package/common.php');
								//查詢所有的站別
								$result=setting_select();
								if(!$result){						
									echo "<script>alert('MySql資料庫搜尋失敗, 請跟開發人員查明原因...');</script>";
									exit();
								}
								$rows = mysqli_num_rows($result);		// 返回结果集中栏位的数量。	
			
								
								if ($rows == 0) { 
									echo "<option value='null'>null data</option>";
								} else {									
									while ( $getArray = mysqli_fetch_array($result,MYSQLI_ASSOC) ) {
										$put_wsid        = $getArray['web_wsid'];
										echo "<option value=$put_wsid>$put_wsid</option>";
									}
								}
							?> 
						</select>&nbsp;<input type="button" value="Add( 新增 )" onclick="AddStr();"><br>
						<input id='input_wsid' name="webul_wsid" type="text" maxlength="45" size="45"/></th><th><font size="2" color="#FF0000"><b>若多个站别,请通过Add(新增)按钮方式增加(浏览器版本需IE10及以上)，或者若IE8及以下版本不能正常添加，请以','逗号作区隔手动方式添加,Ex:F/T-B,B/I,...</b></font></th></tr>
					<tr><th>TPVER(程式版本)</th><th><input id="webul_mfg_ver" name="webul_mfg_ver" type="text" maxlength="45" size="45"/></th><th></th></tr>
					<tr><th>Work Order(工單)</th>
						<th><select name='webul_work_order' style="width:180px;" size="1">
							<option value='N/A'>N/A</option>
							<option value='R'>R-Sample Run(样品产)</option>
							<option value='T'>T-Pilot Run(小量产)</option>
							<option value='B'>B-Bench Run(试产)</option>
							<option value='G'>G-MP(量产)</option>
							<option value='K'>K-Rework(重工产)</option>
							<option value='M'>M-RMA(退货产)</option>
							<option value='L'>L-二廠产</option>
						</select></th><th><font size="2" color="#FF0000"><b>若上传为 SMT,H/P,ICT,SCT,ROUTER,WS-PROFILE,ESD,DOC,此处填 N/A。其他,请询问 PM 后,再选择工单类型。</b></font></th>
					</tr>
					<tr><th>Description(描述)</th><th><textarea name="webul_descript" rows="5" cols="34"></textarea></th><th></th></tr>
				</table>
				<br>
				<input type="submit" value="Submit( 提交 )">&nbsp;<input type="reset" value="Clean( 清除 )"><br><br>
			</form>
		</center>
	</body>
</html>


